package com.kyrie.lib_sys.rocketMQ.Consumer;

import com.kyrie.lib_sys.common.pojo.entity.Author;
import com.kyrie.lib_sys.rocketMQ.pojo.UserPojo;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 监听对象消息示例（消息体为JSON）
 *
 * @author heefM
 * @date 2025-
 */
@Component
@Slf4j
@RocketMQMessageListener(topic = "PojoTopic", consumerGroup = "user-consumer-group")
public class UserPojoMessageConsumer implements RocketMQListener<UserPojo> { // 使用自定义对象

    @Override
    public void onMessage(UserPojo userPojo) {
        log.info(">>>>>>>>>> 收到作者消息: {}", userPojo.toString());
    }
}
